package com.ruimei.controller;

import com.ruimei.service.FileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;

@Controller
@Api(tags={"档案查询"})
public class FileController {
    @Resource
    FileService FileService;

    @ApiOperation("获取学生信息")
    @PostMapping("/getstudent")
    @ResponseBody
    public Map<String, Object> getStudentById(String studentId) {
        Map<String, Object> map = FileService.getStudentById(studentId);
        return map;
    }

    @ApiOperation("获取教师档案")
    @PostMapping("/searchTeacher")
    @ResponseBody
    public Map<String, Object> searchTeacher(String teacherName) {
        Map<String, Object> map = FileService.searchTeacher(teacherName);
        return map;
    }

    @ApiOperation("获取学生档案")
    @PostMapping("/searchStudent")
    @ResponseBody
    public Map<String, Object> searchStudent(String studentName) {
        Map<String, Object> map = FileService.searchStudent(studentName);
        return map;
    }

}
